Vials are containers with a lid for accommodating solid medicines such as tablets, capsulated drugs, etc. In hospitals or drug stores, vials filled with medicines customized for patients are handed over to such patients or their attendants. Conventionally, the tasks of filling vials with medicines and further arranging such vials in predetermined places are manually done by pharmacists. The pharmacist selects one medicine among different types of stocked medicines according to a prescription made by a doctor, counts the quantity of the selected medicine and fills a vial with the selected medicine. Thereafter, the pharmacist arranges the vial in a predetermined place (e.g., shelf) assigned to each patient or hands over the same to the patients.
However, such task of manually selecting the medicine and filling the vial is extremely burdensome. In this regard, the applicants suggested a medicine filling and dispensing apparatus, which automatically performs serial operations from selecting a medicine to filling a vial, as disclosed in Patent Document 1. By utilizing the medicine filling and dispensing apparatus disclosed in Patent Document 1, automation of the task of filling vials with medicines is achieved, thereby realizing an efficient task and preventing occurrence of human mistakes in advance.    Patent Document 1: Japanese Laid-Open Patent Application No. (Hei)11-70901
However, if the medicines cannot be accommodated in one vial due to a large amount or if there are various types of medicines, then the medicines must be provided by numerous vials. However, according to the medicine filling and dispensing apparatus disclosed in the above-mentioned Patent Document 1, vials filled with medicines are sequentially discharged in a row, and thus, two or more vials cannot be arranged in the same shelf. For example, when various types and large amounts of medicines are prescribed, the number of vials to be used increases as much and the shelves for arranging the vials related to the same prescription also increase. Accordingly, operators must remove the vials out of a plurality of the shelves and hand over the vials to the patients. However, if such shelves are interspersed, then mistakes in removing the vials caused by the operator are highly likely to occur. That is, in case the vials must be distributed to and arranged in multiple shelves, such shelves are preferably immediately placed adjacent to one another. However, a higher number of shelves make it difficult to position all the shelves closely to one another. Thus, it is an object of the present invention to provide a device and a method for arranging vials, which can efficiently arrange a plurality of vials in the same arrangement place.